/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package src;

import java.util.Comparator;

/**
 *
 * @author pabloavila
 */
public class CompararUsuarios implements Comparator<Usuario>{


    /**
      * Return a negative integer,
      * zero, or a positive integer as
      * this object is less than, equal to,
      * or greater than the specified object.
      */
    @Override
    public int compare(Usuario t1, Usuario t2) {
        if (t1.getPermisos() == t2.getPermisos()){
           return t1.getNombre().compareTo(t2.getNombre());
       } else return t1.getPermisos().compareTo(t2.getPermisos());
    }
    
}
